<%-- 
    Document   : listCity
    Created on : 26 Oct, 2012, 11:48:03 AM
    Author     : santosh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
    </head>
    <body>
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>

        <div class="in_02">
            <%@include file="../common/message.jsp" %>

            <form id="form1" method="post">
                <fieldset style="width: 60px; height: 80px">
                    <legend>Select options</legend>
                    <table class="formTable">
                        <tr>
                            <td>State:<br/><select id="stateId" name="stateId" class="userInputMedium">
                                    <option value="0">-</option>
                                    <c:forEach items="${stateList}" var="item">
                                        <option <c:if test="${stateId==item.stateId}">selected</c:if> value="${item.stateId}">
                                            ${item.stateName}
                                        </option>
                                    </c:forEach>
                                </select>
                            </td>
                            <td><br/><input  type="submit" value="Go" name="Go" /></td>
                        </tr>
                    </table>
                </fieldset>
            </form>
            <form>
                &nbsp;&nbsp;&nbsp;
                <sec:authorize ifAnyGranted="ROLE_BF_CITY_ADD">
                <span style="font-size: 15px; font-weight: bold;"><a href="../city/addCity.htm">Add city</a></span>
                </sec:authorize>
                <br/><br/>    

                &nbsp;&nbsp;&nbsp;&nbsp;<strong style="margin:0 100px 0 0"><spring:message code="title.cityList"/></strong>
                <c:out value="${fn:length(filterCity)}"/> <spring:message code="rowsFound"/>
                <table class="data_table" border="1px">
                    <thead>
                        <tr class="header">
                            <td align="center"><spring:message code="cityId"/></td>
                            <td align="center"><spring:message code="cityName"/></td>
                            <td align="center"><spring:message code="stateName"/></td>
                            <sec:authorize ifAnyGranted="ROLE_BF_CITY_EDIT">
                            <td>&nbsp;</td>
                            </sec:authorize>
                        </tr>
                    </thead>
                    <c:forEach items="${filterCity}" var="cityItem">
                        <tr>
                            <td align="center"><c:out value="${cityItem.CITY_ID}"/></td>
                            <td align="center"><c:out value="${cityItem.CITY_NAME}"/></td>
                            <td align="center"><c:out value="${cityItem.STATE_NAME}"/></td>
                            <sec:authorize ifAnyGranted="ROLE_BF_CITY_EDIT">
                                <td><a href="editCity.htm?cityId=<c:out value="${cityItem.CITY_ID}"/>"><img src="../images/edit.png"  width="20" height="20" style="border: none" alt="Edit" title="Edit"/></a></td>
                                    </sec:authorize>
                        </tr>
                    </c:forEach>
                </table>
                &nbsp;&nbsp;&nbsp;<c:out value="${fn:length(filterCity)}"/> <spring:message code="rowsFound"/>
                <br/><br/> &nbsp;&nbsp;&nbsp;
                <sec:authorize ifAnyGranted="ROLE_BF_CITY_ADD">
                <span style="font-size: 15px; font-weight: bold;"><a href="../city/addCity.htm">Add city</a></span> 
                </sec:authorize>

        </div>
    </form>
</body>
</html>
